import qrcode
img = qrcode.make('MHX真帅')
img.save('mhx.png')
# from pynput import keyboard
# from playsound import playsound
# from threading import Thread
# count = 0
# def on_release(key):
#     print(key)
#     global count
#     count += 1
#     if count % 10 == 0:
#         t = Thread(target=playsound, args=('ding.mp3',))
#         t.start()
#         #playsound('ding.mp3')
# listener = keyboard.Listener(on_release=on_release)
# listener.start()
# listener.join()
# from pynput import keyboard
# from playsound import playsound
# count = 0
# def on_release(key):
#     print(key)
#     global count
#     count += 1
#     if count % 10 == 0:
#         playsound('ding.mp3')
# listener = keyboard.Listener(on_release=on_release)
# listener.start()
# listener.join()
# import xlrd
#  # 1. 打开 xlsx 文件
# xlsx = xlrd.open_workbook('d:/test.xlsx')
#  # 2. 获取 0 号标签页. (当前只有一个标签页)
# table = xlsx.sheet_by_index(0)
#  # 3. 获取总行数
# nrows = table.nrows
#  # 4. 遍历数据
# count = 0
# total = 0
# for i in range(1, nrows):
# # 使用 cell_value(row, col) 获取到指定坐标单元格的值.
#     classId = table.cell_value(i, 1)
#     if classId == 101:
#         total += table.cell_value(i, 2)
#         count += 1
# print(f'平均分: {total / count}')
# import qrcode
# img = qrcode.make('汤老湿真帅')
# img.save('qrcode.png')
# import os
# inputPath = input('请输入待搜索路径: ')
# pattern = input('请输入待搜索关键词: ')
# for dirpath, dirnames, filenames in os.walk(inputPath):
#     for f in filenames:
#         if pattern in f:
#             print(f'{dirpath}/{f}')
# def countPrefixes(words, s):
#     res = 0   # 符合要求字符串个数
#     for word in words:
#         if s.startswith(word):
#             res += 1
#     return res
# print(countPrefixes(["a","b","c","ab","bc","abc"], "abc"))
# def rotateString(s, goal):
#     return len(s) == len(goal) and goal in s + s
# print(rotateString('abcde', 'cdeab'))
# def reverseWords(s):
#     tokens = s.split()
#     tokens.reverse()
#     return ' '.join(tokens)
# print(reverseWords('I am a student.'))
# import datetime
# date1 = datetime.datetime(2022, 8, 8)
# date2 = datetime.datetime(2025, 1, 24)
# print(date1)
# print(date2)
# print(date2 - date1)
# with open('d:./test.txt', 'r', encoding='utf-8') as f:
#     lines = f.readlines()
#     print(lines)
# f = open('d:./test.txt', 'r',encoding='utf-8')
# lines = f.readlines()
# print(lines)
# f.close()
# f = open('d:./test.txt', 'r',encoding='utf-8')
# for line in f:
#     print(f'line = {line}',end='')
# f.close()
# f = open('d:./test.txt', 'r')
# result = f.read(10)
# print(result)
# f.close()
# f = open('d:/test.txt', 'w')
# f.write('hello')
# f.close()
# f.write('world')
# f = open('d:./test.txt', 'w')
# f.write('hello')
# f.close()
# f = open('d:./test.txt', 'a')
# f.write('world')
# f.close()
# f = open('d:/test.txt', 'r')
# f.write('hello')
# f.close()
# f = open('d:./test.txt', 'w')
# f.write('hello')
# f.close()
# flist = []
# count = 0
# while True:
#     f = open('d:./test.txt', 'r')
#     flist.append(f)
#     count += 1
#     print(f'count = {count}')